@extends('admin.author.layout.layout')
@section('content')
<div class="panel panel-default">
    <div class="panel-heading">
        书籍列表
    </div>
    <!-- /.panel-heading -->
    <div class="panel-body">
        <div class="table-responsive">
            @if(session('success'))
            <div class="alert alert-success">
                {{session('success')}}
            </div>    
            @endif
            <table class="table table-striped table-bordered table-hover">
                <thead>
                    <tr>
                        <th>ID</th>
                        <th>书籍名称</th>
                        <th>书籍简介</th> 
                        <th>书籍封面</th>
                        <th>书籍类型</th>
                        <th>是否免费</th>
                        <th>是否完结</th>
                        <th>审核状态</th>
                        <th>操作</th>
                    </tr>
                </thead>
                <tbody>
                @foreach($books as $k=>$v)
                    <tr style="text-align:center;">
                        <td>{{$v->id}}</td>
                        <td>{{$v->b_name}}</td>
                        <td style="max-width:300px">{{$v->b_desc}}</td>
                        <td>
                            @if($v->b_pic)
                                <img width="65px" height="100px" src="{{$v->b_pic}}">
                            @else
                                <img width="65px" height="100px" src="/uploads/books/default.jpg">
                            @endif        
                        </td>
                        <td>@if($v->b_cate == 0)
                                玄幻
                            @elseif($v->b_cate == 1)
                                武侠 
                            @elseif($v->b_cate == 2)
                                科幻
                            @elseif($v->b_cate == 3)
                                言情 
                            @elseif($v->b_cate == 4)
                                穿越
                            @elseif($v->b_cate == 5)
                                修真
                            @elseif($v->b_cate == 6)
                                历史
                            @elseif($v->b_cate == 7)
                                恐怖
                            @elseif($v->b_cate == 8)
                                悬疑
                            @else
                                其他    
                            @endif
                        </td>
                        <td>
                            @if($v->isfree == 0)
                                免费
                            @else
                                收费    
                            @endif
                        </td>
                        <td>@if($v->isend == 0)
                                完结
                            @else
                                连载    
                            @endif
                        </td>
                        <td>@if($v->status == 0)
                                未审核
                            @else
                                审核通过  
                            @endif
                        </td>
                        <td>

                            @if($v->status == 0 ||$v->status == 2)
                                 <a href="{{url('/admin/books/edit',['id'=>$v->id])}}">编辑</a>
                            @else
                                 <a href="javascript:void(0);" style="color:#898C7D;cursor:no-drop">编辑</a>
                            @endif
                        </td>
                    </tr>
                @endforeach    
                </tbody>
            </table>
        </div>
        <!-- /.table-responsive -->
    </div>
    <!-- /.panel-body -->
</div>
@endsection